<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<c:set var="queryList" value="${pageContext.request.contextPath}/synclog/list" />

<script type="text/javascript"
	src="${ctx}/static/js/jquery-1.8.3.min.js"></script>
	<div class="iframe-cot pull-right" id="smIframe" style="background:#FFFFFF;">
                
             <div class="right-form">
             <form id="_query_form" action="" class="form-inline" onsubmit="return false;">
                  <div class="tb_search">
                  	<div class="pull-left">
              			<span class="search-more">更多条件<i class="fa fa-angle-down ml5"></i></span>
                          <div class="form-group">
                          <label for="dataName">数据名称：</label>
						  <input type="text" name="dataName"/>
                          </div>
                          <div class="form-group">
                          <label for="dataType">数据类型：</label>
							<select name="dataType"> <option value="">请选择</option>
									  <option value="app">应用</option>
									  <option value="appgroup">角色</option>
									  <option value="unit">机构</option>
									  <option value="user">用户</option>
							</select>
                          </div>
						<div class="form-group">
                          <label for="operationType">操作类型：</label>
                          <select name="operationType"> <option value="">请选择</option>
									  <option value="add">新增</option>
									  <option value="delete">删除</option>
									  <option value="update">修改</option>
						 </select>
                         </div>
						<div class="form-group">
                          <label for="syncResult">同步结果：</label>
							<select name="syncResult"> <option value="">请选择</option>
									  <option value="success">同步成功</option>
									  <option value="fail">同步失败</option>
						 </select>
                          </div>
                      
                    </div>
                </div>
                </form>
             </div>
             
             <div class="line-e6e"></div>
             
             <div class="form-top">
                  <div class="pull-left">
                     <button class="btn btn-default" onclick="resyncfaildata()"><i class="fa fa-plus mr5"></i>同步</button> 
                  	  
					<%--  <shiro:hasPermission name="common-service-role:delete"> --%> 
                       <button class="btn btn-default" onclick="deleteBatch('${ctx}/synclog/delete')"><i class="fa fa-times mr5"></i>删除</button>
                     <%-- </shiro:hasPermission>  --%>
                  
                  </div>
                  <div class="pull-right">
                  <shiro:hasPermission name="common-service-role:query">
                      <a class="btn btn-orange" onclick="changePage('${queryList }/table','#_query_form','1','${pageBean.pageSize }',0,true)"><i class="fa fa-search mr5"></i>查询</a>
                      <a class="btn btn-blue" onclick="clearForm('#_query_form');"><i class="fa fa-trash-o mr5"></i>清空</a>
                 </shiro:hasPermission>
                  </div>
             </div>
            <div id="table-papination">
            	
            </div>
      </div>          

          <!--main end--> 
 <script src="${ctx}/static/js/search-more.js"></script>  <!--更多查询条件-->     
 <script type="text/javascript">

 currentPageNo = parseInt('${pageBean.currentPage}');
 currentPageSize = parseInt('${pageBean.pageSize }');
 totalPageCount = parseInt('${pageBean.totalPage}');
 queryUrl = '${ctx}/synclog/list';
 
 $(document).ready(function(){
	 loadConent('${queryList }/table','',true);
 });
 var isResyncing = false;
 function resyncfaildata(){
	 layer.confirm("请确认是否同步数据",{
		 btn:['确认','取消'],
		 yes: function(index){
			 if(isResyncing){
				 return;
			 }
			 $.post('/synclog/resyncFailData',{},function(result){
		  	  		if(result.code=="success"){
		  	  			 successTip();
		  	  			 jumpPage(1,'',true);
		  	  		}else{
		  	  		errorTip();
		  	  		}
		  	  		isResyncing = false;
		  	  	},"json"); 
		 }
	 });
	
 }
 
 </script>